import Vue from 'vue'
import VueRouter from 'vue-router'
import Login from '@/views/Login'
import Layout from '@/views/Layout'
import Home from '@/views/Home'
import User from '@/views/User'
import Slot from '@/components/solts/index.vue'
import Ssot from '@/components/solt.vue'
import Search from '@/views/Search'
import SearchResult from '@/views/Search/SearchResult.vue'
Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    redirect: '/Login'
  },
  {
    path: '/Login',
    component: Login
  },
  {
    path: '/Layout',
    component: Layout,
    redirect: '/Layout/Home',
    children: [
      {
        path: 'Home',
        component: Home
      },
      {
        path: 'User',
        component: User
      }
    ]
  },
  {
    path: '/Slot',
    component: Slot
  },
  {
    path: '/Ssot',
    component: Ssot
  },
  {
    path: '/search',
    component: Search
  },
  {
    path: '/search/:keywords',
    component: SearchResult
  }

]

const router = new VueRouter({
  routes
})

export default router
